home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / ncmp424b.zoo / zcmp (.txt) < prev    next >
Microsoft Windows Help File Content  |  1993-03-06  |  772b  |  38 lines

  1. #!/bin/sh
  2. OPTIONS=
  3. FILES=
  4. for ARG
  5.     case "$ARG" in
  6.     -*)    OPTIONS="$OPTIONS $ARG";;
  7.     *)    FILES="$FILES $ARG";;
  8.     esac
  9. if test -z "$FILES"; then
  10.     echo "Usage: zcmp [cmp_options] file [file]"
  11.     exit 1
  12. set $FILES
  13. if test $# -eq 1; then
  14.     FILE=`expr $1 : '\(.*\)\.Z' '|' $1`
  15.     zcat $FILE | cmp $OPTIONS - $FILE
  16.     STAT="$?"
  17. elif test $# -eq 2; then
  18.     case "$1" in
  19.     *.Z)    case "$2" in
  20.         *.Z)    F=`basename $2 .Z`
  21.             zcat $2 > /tmp/$F.$$
  22.             zcat $1 | cmp $OPTIONS - /tmp/$F.$$
  23.             STAT="$?";;
  24.         *)    zcat $1 | cmp $OPTIONS - $2;;
  25.         esac;;
  26.     *)    case "$2" in
  27.         *.Z)    F=`basename $2 .Z`
  28.             zcat $2 > /tmp/$F.$$
  29.             cmp $OPTIONS $1 /tmp/$F.$$
  30.             STAT="$?";;
  31.         *)    cmp $OPTIONS $1 $2
  32.             STAT="$?";;
  33.         esac;;
  34.     esac
  35.     exit "$STAT"
  36.     echo "Usage: zcmp [cmp_options] file [file]"
  37.     exit 1
  38.